Create VA
Path
- URL:
/cb-core/api/v1/va/create - Method:
POST - Description: This API allows to create Virtual Accounts(VA) for the Sellers who want Baokim to collect the VND amount via VA
Request
Request Table
| Params | Data Type + Length | Required | Description |
|---|---|---|---|
| request_id | string(50) | Yes | Unique request ID, suggested format: MerchantCode+YYYYMMDDHHMMSS+UniqueId |
| request_time | string(19) | Yes | Request time in format: YYYY-MM-DD HH:MM:SS |
| merchant_code | string(20) | Yes | Merchant code provided by Baokim before integration |
| sub_merchant_code | string(50) | Yes | If the Seller is under your sub-merchant, fill your sub merchant code provided by Baokim. If Seller is under you, fill your Merchant_code provided by Baokim as above |
| seller_id | string(50) | Yes | Seller ID matching the Onboarding Sellers API |
| mid | string(50) | No | On-platform MID of the Seller (optional, only for On-platform merchants) |
| acc_name | string(63) | Yes | Virtual Account holder's name |
| reference_code | string(100) | Yes | The reference code of VA managed in your system. This code is unique |
| type | int(1) | No | 1: Collect the correct amount, 2: Collect the free amount. Default = 2 |
| amount | string(25) | No | type = 1 => The amount you want to collect |
| number_of_times_collect | string(25) | Yes | -1: unlimited, >= 1 number of times collect |
| expire_date | string(19) | Yes | Format: YYYY-MM-DD HH:MM:SS |
| memo | string(255) | No | Transfer remark when transfering amount into QR |
| va_purpose | int(1) | Yes | Purpose of the Virtual Account 1: Ecom Shopee Vietnam 2: Ecom Lazada Vietnam 3: Ecom Tiktokshop Vietnam 4: B2B 5: Website 6: Other 7: All |
Request Example
{
"request_id": "MERCHANT12345678901234510281",
"request_time": "2024-11-15 14:36:00",
"merchant_code": "PHUONGTT",
"sub_merchant_code": "SUBPHUONGTT",
"seller_id": "SELLER12345",
"mid": "MID12345",
"acc_name": "Nguyen Van A",
"reference_code": "REF1231081",
"type": 1,
"amount": "1000000",
"number_of_times_collect": "10",
"expire_date": "2024-11-20 12:00:00",
"memo": "Payment for order 12345",
"va_purpose": 1
}
Response
Response Table
| Params | Data Type + Length | Required | Description |
|---|---|---|---|
| response_code | int(4) | Yes | Error code from Baokim as per Error Codes Table |
| response_message | string(100) | Yes | Description of the error code from Baokim as per Error Codes Table |
| merchant_code | string(20) | Yes | Merchant code provided by Baokim before integration |
| reference_code | string(100) | Yes | The reference code of VA managed in your system. This code is unique |
| status | int(1) | Yes | 1: Active; 2: Inactive |
| expire_date | string(19) | Yes | Format: YYYY-MM-DD HH:MM:SS |
| account_info | object | Yes | Virtual account details |
| account_info.bank_name | string(100) | Yes | Bank name |
| account_info.bank_no | string(6) | Yes | Bank no |
| account_info.bank_branch | string(100) | Yes | Bank branch |
| account_info.acc_no | string(22) | Yes | Bank account number |
| account_info.acc_name | string(63) | Yes | Account holder's name |
| account_info.qr | string(100) | Yes | QR string encoded with base64 |
| account_info.qr_path | string(100) | Yes | QR image path |
Response Example
{
"response_code":200,
"response_message":"Success",
"merchant_code":"PHUONGTT",
"reference_code":"REF1231081",
"status":1,
"expire_date":"2024-11-20 12:00:00",
"account_info":{
"bank_name":"Ngân hàng Thương mại Cổ phần Đầu tư và Phát triển Việt Nam",
"bank_no":"970418",
"bank_branch":"Hà Nội",
"acc_no":"963336011173760",
"acc_name":"NGUYEN VAN A",
"qr":"00020101021238590010A0000007270129000697041801159633360111737600208QRIBFTTA5303704540710000005802VN6304DC31",
"qr_path":"https://devtest.baokim.vn/vietqr/core/view/BKREF123108120241115143913.jpg"
}
}
Error Code
| Response Code | Response Message |
|---|---|
| 200 | Success |
| 99 | Pending |
| 11 | Failed |
| 101 | System Error |
| 110 | Merchant Code Invalid |
| 120 | Invalid Signature |
| 422 | Validation Error |